package com.mao.extends6constructor;

//子类
public class Teacher extends People {
    private String skills;//技能

    public Teacher() {
    }
    public Teacher(String name, char sex, String skills) {
        //子类构造器调用父类构造器
        //可以把子类继承自父类这部分的数据也完成初始化赋值
        super(name, sex);
        this.skills = skills;
    }

    public String getSkills() {
        return skills;
    }

    public void setSkills(String skills) {
        this.skills = skills;
    }

    @Override
    public String toString() {
        return "Teacher{" +"name: "+getName()+" sex:"+getSex()+
                " skills='" + skills + '\'' +
                '}';
    }
}
